---@diagnostic disable: undefined-global, lowercase-global
workspace "Orange"
	architecture "x64"
	configurations {
		"Debug",
		"Release",
		"Dist"
	}

	outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

	IncludeDir = {}
	IncludeDir["GLFW"] = "Orange/vendor/GLFW/include"
	IncludeDir["Glad"] = "Orange/vendor/Glad/include"
	IncludeDir["ImGui"] = "Orange/vendor/imgui"
	IncludeDir["backends"] = "Orange/vendor/imgui/backends"
	IncludeDir["glm"] = "Orange/vendor/glm"
	IncludeDir["entt"] = "Orange/vendor/entt"
	IncludeDir["stb_image"] = "Orange/vendor/stb_image"


project "Orange"
		location "Orange"
		kind "ConsoleApp"
		language "C++"
		cppdialect "c++17"
		staticruntime "on"

		files{
			"%{prj.name}/vendor/Glad/src/**.cpp",
			"%{prj.name}/src/**.h",
			"%{prj.name}/src/**.cpp",
			"%{prj.name}/Sandbox/**.h",
			"%{prj.name}/Sandbox/**.cpp",
			"%{prj.name}/vendor/stb_image/**.h",
			"%{prj.name}/vendor/stb_image/**.cpp",
			-- glm start --
			"%{prj.name}/vendor/glm/glm/**.hpp",
			"%{prj.name}/vendor/glm/glm/**.inl",
			-- glm end --
		}

		targetdir ("bin/" .. outputdir .. "/%{prj.name}")
		objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
		
		pchheader "orangepch.h"
		pchsource "Orange/src/orangepch.cpp"

		libdirs {
			"%{prj.name}/vendor/GLFW/lib"
		}
		
		includedirs
		{
			"%{prj.name}/vendor/spdlog/include",
			"%{prj.name}/Sandbox",
			"%{prj.name}/src",
			"%{IncludeDir.GLFW}",
			"%{IncludeDir.Glad}",
			"%{IncludeDir.ImGui}",
			"%{IncludeDir.backends}",
			"%{IncludeDir.glm}",
			"%{IncludeDir.entt}",
			"%{IncludeDir.stb_image}",

		}

		defines
		{
			"_CRT_SECURE_NO_WARNINGS",	"GLFW_INCLUDE_NONE"
		}


		postbuildcommands
		{
			("{COPY} ./vendor/GLFW/lib/glfw3.dll ../bin/" .. outputdir .. "/%{prj.name}"),
		}


		filter "system:windows"
			architecture "x64"
			systemversion "latest"
			links {
				"glfw3dll",
				"opengl32"
			}
			defines
			{
				"ORANGE_PLATFORM_WINDOWS"
			}


		filter "system:not windows"
			cppdialect "c++17"
			staticruntime "On"
			links {
				"glfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo",
			}
			defines
			{
				"ORANGE_PLATFORM_MACOS"
			}
		filter "configurations:Debug"
			defines {
				"ORANGE_DEBUG",
				"DORANGE_ENABLE_ASSERT"
			}
			runtime "Debug"
			symbols "on"
		filter "configurations:Release"
			defines "ORANGE_RELEASE"
			runtime "Release"
			optimize "on"
		filter "configurations:Dist"
			defines "ORANGE_DIST"
			runtime "Release"
			optimize "on"

